
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>方法 · Qcanvas V1.0使用文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="lizhicheng">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-sidebar-style/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-auto-scroll-table/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-code-editor/editor.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="example/style/website.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="qgrouplei.html" />
    
    
    <link rel="prev" href="shu-xing.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Qcanvas说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="qcanvas.html">
            
                <a href="qcanvas.html">
            
                    
                    Qcanvas类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="qcanvas/shu-xing.html">
            
                <a href="qcanvas/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="qcanvas/fang-fa.html">
            
                <a href="qcanvas/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="qtextlei.html">
            
                <a href="qtextlei.html">
            
                    
                    Qtext类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="qtextlei/shu-xing.html">
            
                <a href="qtextlei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="qtextlei/fang-fa.html">
            
                <a href="qtextlei/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="qlinelei.html">
            
                <a href="qlinelei.html">
            
                    
                    Qline类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="qlinelei/shu-xing.html">
            
                <a href="qlinelei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="qlinelei/fang-fa.html">
            
                <a href="qlinelei/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="qrectlei.html">
            
                <a href="qrectlei.html">
            
                    
                    Qrect类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="qrectlei/shu-xing.html">
            
                <a href="qrectlei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="qrectlei/fang-fa.html">
            
                <a href="qrectlei/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="qarclei.html">
            
                <a href="qarclei.html">
            
                    
                    Qarc类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="qarclei/shu-xing.html">
            
                <a href="qarclei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="qarclei/fang-fa.html">
            
                <a href="qarclei/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="qanimationlei.html">
            
                <a href="qanimationlei.html">
            
                    
                    Qanimation类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="qanimationlei/shu-xing.html">
            
                <a href="qanimationlei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="qanimationlei/fang-fa.html">
            
                <a href="qanimationlei/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="qimglei.html">
            
                <a href="qimglei.html">
            
                    
                    Qimg类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="qimglei/shu-xing.html">
            
                <a href="qimglei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="qimglei/fang-fa.html">
            
                <a href="qimglei/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="qspiritlei.html">
            
                <a href="qspiritlei.html">
            
                    
                    Qspirit类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="qspiritlei/shu-xing.html">
            
                <a href="qspiritlei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="qspiritlei/fang-fa.html">
            
                <a href="qspiritlei/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="qshapelei.html">
            
                <a href="qshapelei.html">
            
                    
                    Qshape类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="qshapelei/shu-xing.html">
            
                <a href="qshapelei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="qlayerlei.html">
            
                <a href="qlayerlei.html">
            
                    
                    Qlayer类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="shu-xing.html">
            
                <a href="shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.11.2" data-path="fang-fa.html">
            
                <a href="fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="qgrouplei.html">
            
                <a href="qgrouplei.html">
            
                    
                    Qgroup类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="qgrouplei/fang-fa.html">
            
                <a href="qgrouplei/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="qpolygonlei.html">
            
                <a href="qpolygonlei.html">
            
                    
                    Qpolygon类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="qpolygonlei/shu-xing.html">
            
                <a href="qpolygonlei/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="qquadraticCurve.html">
            
                <a href="qquadraticCurve.html">
            
                    
                    QquadraticCurve类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="qquadraticCurve/shu-xing.html">
            
                <a href="qquadraticCurve/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="qquadraticCurve/fang-fa.html">
            
                <a href="qquadraticCurve/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="qbezierCurve.html">
            
                <a href="qbezierCurve.html">
            
                    
                    QbezierCurve类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="qbezierCurve/shu-xing.html">
            
                <a href="qbezierCurve/shu-xing.html">
            
                    
                    属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="qbezierCurve/fang-fa.html">
            
                <a href="qbezierCurve/fang-fa.html">
            
                    
                    方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >方法</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x6CE8;&#xFF1A;&#x65B9;&#x6CD5;&#x662F;&#x6839;&#x636E;&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;&#x81EA;&#x52A8;&#x751F;&#x6210;&#x7684;&#xFF0C;&#x7ED9;&#x5BF9;&#x8C61;&#x8D4B;&#x52A0;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x521D;&#x59CB;&#x5C5E;&#x6027;&#xFF0C;&#x4E5F;&#x4F1A;&#x81EA;&#x52A8;&#x6DFB;&#x52A0;&#x76F8;&#x5E94;&#x7684;&#x65B9;&#x6CD5;<br>&#x683C;&#x5F0F;&#x4E3A; set+&#x5C5E;&#x6027;&#x540D;&#x79F0;&#xFF08;&#x9996;&#x5B57;&#x6BCD;&#x4F1A;&#x81EA;&#x52A8;&#x8F6C;&#x6210;&#x5927;&#x5199;&#xFF09;</p>
<table>
<thead>
<tr>
<th style="text-align:left">&#x5E8F;&#x53F7;</th>
<th style="text-align:left">&#x540D;&#x79F0;</th>
<th style="text-align:left">&#x53C2;&#x6570;&#x7C7B;&#x578B;</th>
<th style="text-align:left">&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">1</td>
<td style="text-align:left">push</td>
<td style="text-align:left">Object</td>
<td style="text-align:left">&#x6DFB;&#x52A0;&#x5143;&#x7D20;&#x5230;Qlayer&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;&#x4E2D;(&#x591A;&#x4E2A;&#x5143;&#x7D20;&#x5BF9;&#x8C61;&#x4EE5;&#x9017;&#x53F7;&#x9694;&#x5F00;&#x5373;&#x53EF;)</td>
</tr>
<tr>
<td style="text-align:left">2</td>
<td style="text-align:left">getEleById</td>
<td style="text-align:left">String</td>
<td style="text-align:left">&#x901A;&#x8FC7;Id&#x83B7;&#x53D6;&#x5230;&#x5143;&#x7D20;&#x5BF9;&#x8C61;</td>
</tr>
<tr>
<td style="text-align:left">3</td>
<td style="text-align:left">removeEle</td>
<td style="text-align:left">String</td>
<td style="text-align:left">&#x5220;&#x9664;&#x5143;&#x7D20;&#x5BF9;&#x8C61;</td>
</tr>
<tr>
<td style="text-align:left">4</td>
<td style="text-align:left">getIndexById</td>
<td style="text-align:left">String</td>
<td style="text-align:left">&#x901A;&#x8FC7;Id&#x5F97;&#x5230;&#x5143;&#x7D20;&#x5728;elements&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x7D22;&#x5F15;</td>
</tr>
<tr>
<td style="text-align:left">5</td>
<td style="text-align:left">lower</td>
<td style="text-align:left">Object</td>
<td style="text-align:left">&#x628A;&#x5143;&#x7D20;&#x964D;&#x4F4E;&#x4E00;&#x4E2A;&#x5C42;&#x7EA7; (&#x53C2;&#x6570;&#x4E3A;&#x5143;&#x7D20;&#x5BF9;&#x8C61;)</td>
</tr>
<tr>
<td style="text-align:left">6</td>
<td style="text-align:left">lowerToBottom</td>
<td style="text-align:left">Object</td>
<td style="text-align:left">&#x628A;&#x5143;&#x7D20;&#x5C42;&#x7EA7;&#x7F6E;&#x5E95;(&#x53C2;&#x6570;&#x4E3A;&#x5143;&#x7D20;&#x5BF9;&#x8C61;)</td>
</tr>
<tr>
<td style="text-align:left">7</td>
<td style="text-align:left">raise</td>
<td style="text-align:left">Object</td>
<td style="text-align:left">&#x628A;&#x5143;&#x7D20;&#x63D0;&#x9AD8;&#x4E00;&#x4E2A;&#x5C42;&#x7EA7;(&#x53C2;&#x6570;&#x4E3A;&#x5143;&#x7D20;&#x5BF9;&#x8C61;)</td>
</tr>
<tr>
<td style="text-align:left">8</td>
<td style="text-align:left">raiseToTop</td>
<td style="text-align:left">Object</td>
<td style="text-align:left">&#x628A;&#x5143;&#x7D20;&#x5C42;&#x7EA7;&#x7F6E;&#x9876;(&#x53C2;&#x6570;&#x4E3A;&#x5143;&#x7D20;&#x5BF9;&#x8C61;)</td>
</tr>
<tr>
<td style="text-align:left">9</td>
<td style="text-align:left">destroy</td>
<td style="text-align:left">&#x65E0;</td>
<td style="text-align:left">&#x6E05;&#x7A7A;layer.elements</td>
</tr>
</tbody>
</table>
<blockquote>
<h5 id="1&#x3001;push">1&#x3001;push</h5>
<p>var layer = qcanvas.qlayer.layer();<br>var text = qcanvas.qtext.text({<br>        start:[100,100],<br>        text:&apos;&#x6211;&#x662F;&#x6765;&#x81EA;layer&#x5BB9;&#x5668;&#x91CC;&#x7684;&#x6587;&#x5B57;&apos;,<br>        color:&apos;red&apos;<br>    })<br>layer.push(text);  //&#x6DFB;&#x52A0;&#x6587;&#x672C;&#x5BF9;&#x8C61;&#x5230;layer&#x4E2D;</p>
</blockquote>
<footer class="page-footer"><span class="copyright">&#xA9; Qcanvas all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2021-07-28 16:44:45
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="shu-xing.html" class="navigation navigation-prev " aria-label="Previous page: 属性">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="qgrouplei.html" class="navigation navigation-next " aria-label="Next page: Qgroup类">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"方法","level":"1.11.2","depth":2,"next":{"title":"Qgroup类","level":"1.12","depth":1,"path":"qgrouplei.md","ref":"qgrouplei.md","articles":[{"title":"方法","level":"1.12.1","depth":2,"path":"qgrouplei/fang-fa.md","ref":"qgrouplei/fang-fa.md","articles":[]}]},"previous":{"title":"属性","level":"1.11.1","depth":2,"path":"shu-xing.md","ref":"shu-xing.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters-small","tbfed-pagefooter","sidebar-style","auto-scroll-table","code-editor","code","lightbox"],"styles":{"website":"example/style/website.css"},"pluginsConfig":{"sidebar-style":{"author":"志成","title":"Qcanvas V1.0使用文档"},"tbfed-pagefooter":{"copyright":"&copy Qcanvas","modify_label":"文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"search":{},"auto-scroll-table":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code-editor":{},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"lightbox":{"jquery":true,"sameUuid":false},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"lizhicheng","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Qcanvas V1.0使用文档","output.name":"Qcanvas V1.0使用文档","gitbook":"*","description":"Qcanvas V1.0使用文档"},"file":{"path":"fang-fa.md","mtime":"2021-07-28T08:44:45.838Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-05-18T10:04:11.263Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sidebar-style/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-auto-scroll-table/plugin.js"></script>
        
    
        
        <script src="http://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.3/ace.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-code-editor/editor.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

